package cn.caishen.report.domain.report;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * 报表用户字段表
 *
 * @author Administrator
 */
@TableName(value = "tb_report_user_field")
@Data
@ApiModel(value = "报表用户字段表")
public class ReportUserField implements Serializable {

    /**
     * 报表用户字段编号
     */
    @TableId(value = "report_user_field_id", type = IdType.AUTO)
    @ApiModelProperty("报表用户字段编号")
    private Integer reportUserFieldId;

    /**
     * 用户编号
     */
    @TableField(value = "user_id")
    @ApiModelProperty("用户编号")
    private Integer userId;

    /**
     * 用户名称
     */
    @TableField(value = "user_name")
    @ApiModelProperty("用户名称")
    private String userName;

    /**
     * 报表配置编号
     */
    @TableField(value = "report_config_id")
    @ApiModelProperty("报表配置编号")
    private Integer reportConfigId;

    /**
     * 字段名称
     */
    @TableField(value = "field_name")
    @ApiModelProperty("字段名称")
    private String fieldName;

    /**
     * 字段长度
     */
    @TableField(value = "field_width")
    @ApiModelProperty("字段长度")
    private Integer fieldWidth;

    /**
     * 删除标志
     */
    @TableField(value = "delete_flag")
    @ApiModelProperty("删除标志")
    private Integer deleteFlag;

    /**
     * 排序
     */
    @TableField(value = "order_by")
    @ApiModelProperty("排序")
    private Integer orderBy;


    @Override
    public boolean equals(Object obj) {
        if (obj instanceof ReportUserField) {
            ReportUserField reportUserField = (ReportUserField) obj;
            return this.getFieldName().equals(reportUserField.getFieldName())
                    && this.getReportConfigId().equals(reportUserField.getReportConfigId())
                    && this.getUserId().equals(reportUserField.getUserId());
        }
        return super.equals(obj);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }
}